Skip to content

fix(source-control): revert the post-merge run-listing split that exhausted the GITHUB_TOKEN pool - #11217

Merged
kyle-sexton merged 1 commit into
mainfrom
revert/post-merge-run-cap
Oct 30, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
revert/post-merge-run-cap

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #11210

Summary

Reverts #11210. With demotion record #11153 open, the post-merge floor falls back to 2026-10-21. #11210's run-listing split then let the check read every run since that floor: about 1,700 GITHUB_TOKEN calls per check. That exhausted the core pool and tripped the breaker at 09:23:30Z.

Fix

A plain git revert of ae3472c, plus a changelog fragment. The check goes back to stopping as unreadable at the 1,000-run search cap, and each candidate re-runs it again. That re-run is slow, but it costs about 49 calls, not about 1,700.

Metrics

pr-merge.yml github-token calls, from the jobs' api-calls annotations:

runs calls mean per run max per run
before #11210 (08:22-08:50Z) 14 312 22.3 149
after #11210 (08:50-09:22Z) 10 2872 287.2 1688

Verification

Related

🤖 Generated with Claude Code

…alves and check an unreadable head once (#11210)"

This reverts commit ae3472c.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-30T09:44:15.175981Z
We couldn’t complete this review. Comment @codex review to try again.
e250822 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@kyle-sexton
kyle-sexton enabled auto-merge October 30, 2026 09:44
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e250822b7e0392a373f7e53772f464b02543011d: 0 finding(s), 0 as inline comments.

No security findings.

critical-findings: 0

This is a revert of #11210's post-merge run-listing split. I read the whole diff, including the changes to the trusted-path files babysit_merge.py and babysit_postmerge.py.

  • The revert tightens the gate. The check goes back to raising PostMergeReadError when a listing hits the 1,000-run search cap. That error means "unreadable", and the gate treats unreadable as a refusal, so it still fails closed. babysit_postmerge.py _runs again reads one created>= range, so no hidden runs can be missed through a split.
  • The unreadable-head reuse is gone. reuse_unreadable and _unreadable_at are deleted. They trusted a previously recorded unreadable answer from the report file. They refused when they reused it, so they never passed a candidate, but the file-based record is no longer a consumer of that state. assess_unattended goes back to calling postmerge.gate_reader(...) directly.
  • No merge hold is weakened. Nothing newly passes the post-merge gate. --postmerge-result is still parsed and handed to read_shared (babysit_merge.py:5411), and the atomic write in write_shared is kept inline.
  • No dangling references. A repo-wide grep for RunSearchCapped, reuse_unreadable, _replace_json, UNREADABLE_KEY and RUN_WINDOW_FLOOR finds nothing outside the deleted code.
  • No trust-control widening. The diff does not touch trusted-actor lists, token scopes, the kill switch or any workflow. It adds no manifest changes and no instruction-surface deletions.
  • Spend. The revert lowers GITHUB_TOKEN API use. It starts no billable resource, so there is no hold.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed e250822b7e0392a373f7e53772f464b02543011d: 0 finding(s), 0 as inline comments.

No findings. The PR is a clean revert of #11210 plus a changelog fragment, and I found nothing to block or flag.

What I checked (by reading the diff and the head files; I ran no tests):

  • Leftover references. I grepped the scripts, tests and workflows for the names the revert removes: RunSearchCapped, reuse_unreadable, UNREADABLE_KEY, unreadableRecompute, unreadableReusedAt, _unreadable_at, RUN_WINDOW_FLOOR and _replace_json. None remain outside the deleted code.
  • --postmerge-result flag. It stays wired in babysit_merge.py and pr-merge.yml. Its remaining uses are read_shared and write_shared, which this PR restores to their pre-fix(source-control): read capped post-merge run listings in halves and check an unreadable head once #11210 form. The deleted postmerge_result= keyword was only the reuse_unreadable wrapper's, so no caller is left passing an argument that no longer exists.
  • _runs signature. All five call sites (babysit_postmerge.py:2331, 2455, 2458 and 2481, plus the multi-line _runs( call that begins at 2458) match the restored signature without now. No test still passes now=, and the tests that exercised it are deleted with it.
  • write_shared. The restored body at babysit_postmerge.py:3815-3855 is complete: the temp-file write, os.replace, the error handling and the return True.
  • Fail-closed behaviour. The reverted _paginated raises PostMergeReadError at the 1,000-run cap, so an unreadable listing is still refused and never passes. The PR description gives the cost as about 49 calls per check instead of about 1,700. That figure is the author's and I did not verify it.
  • Changelog fragment. The bump: patch fragment is under .changes/source-control/, and it replaces the fragment fix(source-control): read capped post-merge run listings in halves and check an unreadable head once #11210 added.

Closing issue: the PR says "Refs: #11210" and closes no issue, so there are no acceptance criteria to check.

Manifests: the diff changes no plugin.json or marketplace.json.

Untested behaviour (informational, not a finding): the reverted code paths lose their tests (test_babysit_postmerge_run_window.py and test_babysit_postmerge_unreadable_reuse.py) along with the code. That is consistent with the revert.

Cost: none. The PR removes GITHUB_TOKEN API calls and adds no paid resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant